package com.blog.backend.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class BlogPlate implements Serializable {

    private static final long serialVersionUID = 991882952037672968L;
    @ApiModelProperty("板块主键id")
    private String plateId;

    @ApiModelProperty("板块名称")
    private String plateName;

    @ApiModelProperty("板块描述")
    private String plateDescription;

    @ApiModelProperty("文章数量")
    private Integer articleNumber;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @JsonIgnore
    private Date updateTime;

    private Integer type;

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    private String time;

    public String getTime() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String timeFormat = format.format(this.createTime);
        return timeFormat;
    }

    public void setTime(String time) {
        this.time = time;
    }


    public String getPlateId() {
        return plateId;
    }

    public void setPlateId(String plateId) {
        this.plateId = plateId == null ? null : plateId.trim();
    }

    public String getPlateName() {
        return plateName;
    }

    public void setPlateName(String plateName) {
        this.plateName = plateName == null ? null : plateName.trim();
    }

    public String getPlateDescription() {
        return plateDescription;
    }

    public void setPlateDescription(String plateDescription) {
        this.plateDescription = plateDescription == null ? null : plateDescription.trim();
    }

    public Integer getArticleNumber() {
        return articleNumber;
    }

    public void setArticleNumber(Integer articleNumber) {
        this.articleNumber = articleNumber;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}